package com.eastfair.imaster.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.eastfair.boot.request.PageParams;
import com.eastfair.boot.service.SuperService;
import com.eastfair.core.base.R;
import com.eastfair.imaster.dto.VisitorRegisterDTO;
import com.eastfair.imaster.dto.VisitorRegisterStateDTO;
import com.eastfair.imaster.dto.VisitorUserDTO;
import com.eastfair.imaster.entity.VisitorUser;
import com.eastfair.imaster.vo.VisitorUserVO;
import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.BusinessActionContextParameter;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;

/**
 * <p>
 * 业务接口
 * 观众用户信息表（根据显示需求灌入数据）
 * </p>
 *
 * @author zjn
 * @date 2021-08-25
 */
@LocalTCC
public interface TccService {

    R executeTcc(Long id);

    /**
     * Prepare boolean.
     *
     * @param id            the
     * @return the boolean
     */

    @TwoPhaseBusinessAction(name = "executeTest", commitMethod = "commit", rollbackMethod = "rollback")
    R executeTest(BusinessActionContext actionContext,
                  @BusinessActionContextParameter(paramName = "id") Long id,
                  @BusinessActionContextParameter(paramName = "name") String addName);

    /**
     * Commit boolean.
     *
     * @param actionContext the action context
     * @return the boolean
     */
    boolean commit(BusinessActionContext actionContext);

    /**
     * Rollback boolean.
     *
     * @param actionContext the action context
     * @return the boolean
     */
    boolean rollback(BusinessActionContext actionContext);
}
